Optimal. Leaf size=32 \[ a^2 \log (x)+\frac{2 a b x^n}{n}+\frac{b^2 x^{2 n}}{2 n} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0126149, antiderivative size = 32, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {266, 43} \[ a^2 \log (x)+\frac{2 a b x^n}{n}+\frac{b^2 x^{2 n}}{2 n} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 266
Rule 43
Rubi steps
\begin{align*} \int \frac{\left (a+b x^n\right )^2}{x} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{(a+b x)^2}{x} \, dx,x,x^n\right )}{n}\\ &=\frac{\operatorname{Subst}\left (\int \left (2 a b+\frac{a^2}{x}+b^2 x\right ) \, dx,x,x^n\right )}{n}\\ &=\frac{2 a b x^n}{n}+\frac{b^2 x^{2 n}}{2 n}+a^2 \log (x)\\ \end{align*}
Mathematica [A] time = 0.0159887, size = 27, normalized size = 0.84 \[ a^2 \log (x)+\frac{b x^n \left (4 a+b x^n\right )}{2 n} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0., size = 36, normalized size = 1.1 \begin{align*}{\frac{ \left ({x}^{n} \right ) ^{2}{b}^{2}}{2\,n}}+2\,{\frac{ab{x}^{n}}{n}}+{\frac{{a}^{2}\ln \left ({x}^{n} \right ) }{n}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.962723, size = 46, normalized size = 1.44 \begin{align*} \frac{a^{2} \log \left (x^{n}\right )}{n} + \frac{b^{2} x^{2 \, n} + 4 \, a b x^{n}}{2 \, n} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.02017, size = 68, normalized size = 2.12 \begin{align*} \frac{2 \, a^{2} n \log \left (x\right ) + b^{2} x^{2 \, n} + 4 \, a b x^{n}}{2 \, n} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.354659, size = 36, normalized size = 1.12 \begin{align*} \begin{cases} a^{2} \log{\left (x \right )} + \frac{2 a b x^{n}}{n} + \frac{b^{2} x^{2 n}}{2 n} & \text{for}\: n \neq 0 \\\left (a + b\right )^{2} \log{\left (x \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (b x^{n} + a\right )}^{2}}{x}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]